package com.gxc.mq;

import lombok.extern.slf4j.Slf4j;
import org.springframework.amqp.core.AmqpTemplate;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;

/**
 * @author GongXincheng
 * @since 2019-08-23 09:10
 */
@Slf4j
@Component
public class Demo2_Provider {

    @Resource
    private AmqpTemplate amqpTemplate;

    public void send() {
        log.info("demo2 send message: " + "GongXincheng");
        amqpTemplate.convertAndSend("demo2", "GongXincheng");
    }

}
